<?php
use yii\helpers\Html;
use yii\helpers\Url;

/**
 * @var $this yii\web\View
 * @var $model_list app\models\SystemMessage[]
 * @var $pagination yii\data\Pagination
 */

$this->title = '群发消息列表';
$this->params['breadcrumbs'][] = '系统管理';
$this->params['breadcrumbs'][] = $this->title;

app\assets\TableAsset::register($this);
app\assets\AjaxAsset::register($this);
?>
<?php echo Html::beginForm('?', 'get', ['class'=>'form-inline']);?>
    <div class="form-group">
        <label for="search_title" class="sr-only">Title</label>
        <input type="text" class="form-control" name="search_title" id="search_title" placeholder="标题" value="<?php echo Yii::$app->request->get('search_title');?>" />
    </div>
    <div class="form-group">
        <button type="submit" class="btn btn-primary btn-sm">搜索</button>
    </div>
    <br />
    <div class="form-group">
        <a href="<?php echo Url::to(['/admin/system/message-edit']);?>" class="btn btn-success btn-sm">添加</a>
    </div>
<?php echo Html::endForm();?>
<table id="simple-table" class="table table-striped table-bordered table-hover">
    <thead>
        <tr>
            <th class="center">
                <label class="pos-rel">
                    <input type="checkbox" class="ace" />
                    <span class="lbl"></span>
                </label>
            </th>
            <th>标题</th>
            <th>时间</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        <?php foreach ($model_list as $model) {?>
            <tr id="data_<?php echo $model->id;?>">
                <td class="center"><label class="pos-rel"><input type="checkbox" class="ace" value="<?php echo $model->id;?>" /><span class="lbl"><?php echo $model->id;?></span></label></td>
                <td><?php echo Html::encode($model->title);?></td>
                <td><?php echo Yii::$app->formatter->asDatetime($model->time);?></td>
                <td> </td>
            </tr>
        <?php }?>
    </tbody>
</table>
<?php echo app\widgets\LinkPager::widget(['pagination'=>$pagination]);?>
